@extends('frontend/layouts/bootstrap')

@section('content')
<div>
    <span style="font-size: 31.5px;  line-height: 40px;  margin: 10px 0;  font-family: inherit;  font-weight: bold;  color: inherit;  text-rendering: optimizelegibility;  -webkit-margin-before: 0.83em;  -webkit-margin-after: 0.83em;  -webkit-margin-start: 0px;  -webkit-margin-end: 0px;"> Auction-д дахин оруулах </span>
    {{ link_to_route('car_balance.main.car_list', 'Машины жагсаалт руу буцах', null, array('class' => 'btn btn-info', 'style' => 'float: right; margin: 10px 0;')) }}
    {{ link_to_route('car_balance.car.car_show', 'Машины мэдээлэл руу буцах', $car->id, array('class' => 'btn btn-info', 'style' => 'float: right; margin: 10px 10px;')) }}
</div>

<h4>Auction-д дахин оруулах машины мэдээлэл</h4>
<table class="table table-bordered" style="margin-bottom: 10px;">
    <thead style="background-color: #f0f0f0;">
    <tr>
        <th title="Date">日付</th>
        <th title="Auction">オーク会場</th>
        <th title="Auction no">出品番号</th>
        <th title="Car model">車種</th>
        <th title="Car year">年式</th>
        <th title="Chassis number">車体番号</th>
        <th title="Customer">Customer</th>
    </tr>
    </thead>
    <tr>
        <td>{{ $car->purchase_date }}</td>
        <td>{{ $car->auction_name }}</td>
        <td>{{ $car->lot_no }}</td>
        <td>{{ $car->car_maker }} {{ $car->car_name }}</td>
        <td>{{ $car->car_year }}</td>
        <td>{{ $car->chasis_no; }}</td>
        <td>{{ $car->customer->name }}</td>
    </tr>
</table>

    {{ Form::open(array('route' => 'car_balance.re_auction.create', 'class' => 'form-horizontal')) }}
    <table class="table table-bordered">
        <thead style="background-color: #f0f0f0;">
        <th title="Re Auction Date">Re Auction Date</th>
        <th title="Service Company">Service Company</th>
        <th title="Transport Company">Transport Company</th>
        <th title="Auction name">Auction name</th>
        <th title="Status">Status</th>
        </thead>

        <tr>

            <td{{ $errors->first('re_auction_date', ' class="control-group error"') }}>
                <input class="datepicker input-medium" placeholder="Re Auction Date" title="Re Auction Date" name="re_auction_date" type="text" value="{{ Input::old('re_auction_date') }}">
                {{ $errors->first('re_auction_date', '<span class="help-inline">:message</span>') }}
            </td>
            <td{{ $errors->first('service_company_id', ' class="control-group error"') }}>
            {{ Form::select('service_company_id', $service_company_list, $car->service_company_id, array('data-placeholder' => 'Service Company', 'class' => 'span2', 'name' => 'service_company_id')) }}
                {{ $errors->first('service_company_id', '<span class="help-inline">:message</span>') }}
            </td>
            <td{{ $errors->first('transport_company_id', ' class="control-group error"') }}>
                {{ Form::select('transport_company_id', $transport_company_list, $car->transport_company_id, array('data-placeholder' => 'Transport Company', 'class' => 'span2', 'name' => 'transport_company_id')) }}
                {{ $errors->first('transport_company_id', '<span class="help-inline">:message</span>') }}
            </td>
            <td{{ $errors->first('auction_name', ' class="control-group error"') }}>
            {{ Form::select('auction_name', $car_auction_list, $car->auction_name, array('data-placeholder' => 'Car Auction', 'class' => 'span2', 'name' => 'auction_name')) }}
                {{ $errors->first('auction_name', '<span class="help-inline">:message</span>') }}
            </td>
            <td>
                <select name="status" id="status" class="input-small">
                    <option value="0" {{ Input::old('status') == '0' ? 'selected' : '' }}>Зарагдаагүй</option>
                    <option value="1" {{ Input::old('status') == '1' ? 'selected' : '' }}>Зарагдсан</option>
                </select>
            </td>
            <input name="purchase_car_id" type="hidden" value="{{ $car->id }}">
        </tr>
    </table>
<table class="table table-bordered">
    <thead style="background-color: #f0f0f0;">
    <th title="Sold Price">Sold Price</th>
    <th title="Sold Vat">Sold Vat</th>
    <th title="Recycle">Recycle</th>
    <th title="Car Tax">Car Tax</th>
    <th title="Transport fee">Transport fee</th>
    <th title="Re Auction Fee">Re Auction Fee</th>
    <th title="Success Fee">Success Fee</th>
    </thead>

    <tr>

        @include('nimo.domains.car_balance.Main._form_field', array('field'=>'re_auction_sold_price'))
        <td>
            <select name="re_auction_sold_vat" id="re_auction_sold_vat" class="input-small">
                <option value="8" {{ Input::old('re_auction_sold_vat') == '8' ? 'selected' : '' }}>8 %</option>
                <option value="5" {{ Input::old('re_auction_sold_vat') == '5' ? 'selected' : '' }}>5 %</option>
            </select>
        </td>
        @include('nimo.domains.car_balance.Main._form_field', array('field'=>'re_auction_recycle_amount'))
        @include('nimo.domains.car_balance.Main._form_field', array('field'=>'re_auction_car_tax_amount'))
        @include('nimo.domains.car_balance.Main._form_field', array('field'=>'re_auction_transport_fee'))
        @include('nimo.domains.car_balance.Main._form_field', array('field'=>'re_auction_fee'))
        @include('nimo.domains.car_balance.Main._form_field', array('field'=>'re_auction_success_fee'))
    </tr>
</table>
    <button type="reset" class="btn btn-large btn-default">Reset</button>
    <button type="submit" class="btn btn-large btn-success"><i class="icon-plus icon-white"></i> Хадгалах</button>
    {{ Form::token() }}
    {{ Form::close() }}

@stop

@section('pagestyles')
<link rel="stylesheet" type="text/css" href={{ asset('assets/bootstrap/bootstrap.css') }} />
<link rel="stylesheet" type="text/css" href={{ asset('assets/bootstrap-datepicker/datepicker.css') }} />
@stop

@section('pagescripts')
<script type="text/javascript" src={{ asset('assets/bootstrap/bootstrap.js') }}></script>
<script type="text/javascript" src={{ asset('assets/bootstrap-datepicker/datepicker.js') }}></script>
<script type="text/javascript" >
    $(document).ready(function(){
        $(function() {
            $( ".datepicker" ).datepicker({
                defaultDate: "+0d",
                format: "yyyy-mm-dd",
                autoclose: true
            });
        });

    });

</script>
@stop